<?php
namespace app\modules\content\models;

use yii\db\ActiveRecord;
use yii;

class Ad extends ActiveRecord
{
    public static function tableName()
    {
        return '{{%ad}}';
    }

    /**
     * @Title  [获取广告文案]
     * @Author Don
     * @Date   2021-04-02
     * @param  [type]
     * @return [type]
     */
    public function getAd($cate)
    {
        $res = self::find()->asArray()->where(['cate'=>$cate])->one();
        return $res;
    }

}